<div class="explorer-apostilles">
  <div class="container-fluid main">
    <div class="row">
      <div class="col-sm-8">
        <h2>{{ 'EXPLORER_APOSTILLES_TITLE' | translate }}</h2>
      </div>
    </div>

  	<explorer-nav></explorer-nav>

    <div class="row">
      <div class="col-md-12">
        <div class="panel-heading">
          <div class="nav nav-tabs arrows">
            <div ng-show="$ctrl.sinkData.length > 5">
              <button class="buttonStyle" ng-disabled="$ctrl.currentPageSink == 0" ng-click="$ctrl.currentPageSink = $ctrl.currentPageSink-1">
                <span class="fa fa-chevron-left" aria-hidden="true"></span>
              </button><b>{{$ctrl.currentPageSink+1}}/{{$ctrl.numberOfPagesSink()}}</b>
              <button class="buttonStyle" ng-disabled="$ctrl.currentPageSink+1 >= $ctrl.numberOfPagesSink()" ng-click="$ctrl.currentPageSink = $ctrl.currentPageSink+1">
                <span class="fa fa-chevron-right" aria-hidden="true"></span>
              </button>
            </div>
          </div>
        </div>
        <table class="table table-condensed">
          <thead>
            <tr>
              <th>{{ 'GENERAL_OWNER' | translate }}</th>
              <th>{{ 'APOSTILLE_FILE_HASH' | translate }}</th>
              <th>{{ 'GENERAL_TRANSACTION_HASH' | translate }}</th>
              <th>{{ 'GENERAL_DATE' | translate }}</th>
            </tr>
          </thead>
        </table>
        <table class="table table-condensed">
          <tbody>
            <tr ng-repeat="tx in $ctrl.sinkData | startFrom:$ctrl.currentPageSink*$ctrl.pageSizeSink | limitTo:$ctrl.pageSizeSink">
              <td>
                <a ui-sref="app.accountsExplorer({address: (tx.transaction.signer | fmtPubToAddress:$ctrl._Wallet.network), privateKey: ''})">{{tx.transaction.signer | fmtPubToAddress:$ctrl._Wallet.network}}</a></td>
              <td>
                <span ng-show="tx.transaction.type === 257">
                  {{ tx.transaction.message.payload }}
                </span>
                <span ng-show="tx.transaction.type === 4100">
                  {{ tx.transaction.otherTrans.message.payload }}
                </span>
              </td>
              <td>
                <span ng-show="tx.transaction.type === 257">
                  <a href="{{$ctrl._Wallet.chainLink}}{{tx.meta.hash.data}}" target="_blank">
                    {{tx.meta.hash.data}}
                  </a>
                </span>
                <span ng-show="tx.transaction.type === 4100">
                  <a href="{{$ctrl._Wallet.chainLink}}{{tx.meta.innerHash.data}}" target="_blank">
                    {{ tx.meta.innerHash.data }}
                  </a>
                </span>
              </td>
              <td>{{tx.transaction.timeStamp | fmtNemDate}}</td>
            </tr>
          </tbody>
        </table>
        <div class="panel-body nothing" ng-show="!$ctrl.sinkData.length">
          <p>{{ 'GENERAL_NO_RESULTS' | translate }}</p>
        </div>
      </div>
    </div>

  </div>
</div>
